package com.breezelin.freshmarket.network.asynctasks;

/**
 * Created by Breeze Lin
 * 2016/9/22 10:10
 * breezesummerlin@163.com
 */

import com.breezelin.freshmarket.entities.data.UserInfo;
import com.breezelin.freshmarket.entities.network.ReqNRsp;
import com.breezelin.freshmarket.network.FMAsyncTask;
import com.breezelin.freshmarket.network.apis.ProfileApi;

/**
 * 登录动作的异步任务
 */
public abstract class LoginTask extends FMAsyncTask<Void, Void, ReqNRsp<UserInfo>> {

	/**
	 * 用户名
	 */
	private String userName;
	/**
	 * 密码
	 */
	private String password;

	/**
	 * 登录动作的异步任务
	 */
	public LoginTask(String userName, String password) {
		super(ProfileApi.LOGIN);
		this.userName = userName;
		this.password = password;
	}

	@Override
	protected ReqNRsp<UserInfo> doInBackground(Void... params) {
		return ProfileApi.login(userName, password);
	}
}
